class Person:
    def __init__(self, name, birth_year):
        self.name = name
        self.birth_year = birth_year

    def getAge(self):
        return 2022 - self.birth_year

    def getName(self):
        return self.name

    def __str__(self):
        return f"姓名：{self.getName()},年龄：{self.getAge()}"
class Instructor(Person):
    def __init__(self, name, birth_year,degree):
        super().__init__(name, birth_year)
        self.degree = degree
    def getDegree(self):
        return self.degree
    def __str__(self):
        return f"教师：姓名：{self.getName()},年龄：{self.getAge()},学位：{self.getDegree()}"
class Student(Person):
    def __init__(self, name, birth_year,major):
        super().__init__(name, birth_year)
        self.major = major
    def getMajor(self):
        return self.major
    def __str__(self):
        return f"学生：姓名：{self.getName()},年龄：{self.getAge()},专业：{self.getMajor()}"
def main():
    name = input()
    year = int(input())
    degree = input()
    major = input()
    p = Person(name,year)
    print(p)
    t = Instructor(name,year,degree)
    print(t)
    s = Student(name,year,major)
    print(s)

main()

